package com.huanong.controller;
/*
 *@Author:anran
 *@Date:2020/12/7
 *@Version 1.0
 */

import com.huanong.common.grace.result.GraceJSONResult;
import com.huanong.pojo.Product;
import com.huanong.pojo.vo.ProductInsertVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(value = "产品信息接口",tags = {"产品信息"})
@RequestMapping("/product")
@CrossOrigin(origins = "*")
public interface ProductControllerApi {

    @ApiOperation(value = "查询产品信息接口",notes = "查询产品信息",httpMethod = "GET")
    @GetMapping("/queryProduct")
    GraceJSONResult queryProduct();

    @ApiOperation(value = "根据id查询产品信息接口",notes = "查询产品信息",httpMethod = "GET")
    @GetMapping("/queryProductById")
    GraceJSONResult queryProductById(@RequestParam("PtId") Integer PtId);

    @ApiOperation(value = "根据分类id查询产品信息接口",notes = "根据分类id查询产品信息接口",httpMethod = "GET")
    @GetMapping("/queryProductByClassifyId")
    GraceJSONResult queryProductByClassifyId(@RequestParam("tsId") Integer tsId);

    @ApiOperation(value = "新增产品信息接口",notes = "新增产品信息",httpMethod = "POST")
    @PostMapping("/addProduct")
    GraceJSONResult addProduct(@RequestBody ProductInsertVo product);

    @ApiOperation(value = "删除产品信息接口",notes = "删除产品信息",httpMethod = "GET")
    @GetMapping("/deleteProduct")
    GraceJSONResult deleteProduct(@RequestParam("PtId") Integer PtId);

    @ApiOperation(value = "更新产品信息接口",notes = "更新产品信息",httpMethod = "POST")
    @PostMapping("/updateProduct")
    GraceJSONResult updateProduct(@RequestBody ProductInsertVo product);
}
